{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Temperature():\n",
    "    def __init__(self, celcius):\n",
    "        self.celcius = celcius\n",
    "    \n",
    "    @property\n",
    "    def fahrenheit(self):\n",
    "        return self.celcius * 9 / 5 + 32"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Temperature():\n",
    "    def __init__(self, celsius):\n",
    "        self.celsius = celsius\n",
    "    \n",
    "    @property\n",
    "    def fahrenheit(self):\n",
    "        return self.celsius * 9 / 5 + 32\n",
    "    \n",
    "    @fahrenheit.setter\n",
    "    def fahrenheit(self, value):\n",
    "        self.celsius = (value - 32) * 5 / 9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "41.0"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp = Temperature(5)\n",
    "temp.fahrenheit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp.fahrenheit = 32\n",
    "temp.celsius"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
